<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="CitaEditDlg" widgetVar="CitaEditDialog" modal="true" resizable="false" appendTo="@(body)" header="#{bundle.EditCitaTitle}">
            <h:form id="CitaEditForm">
                <h:panelGroup id="display">
                    <p:panelGrid columns="2" rendered="#{citaController.selected != null}">
                        <p:outputLabel value="#{bundle.EditCitaLabel_fechacita}" for="fechacita" />
                        <p:calendar id="fechacita" pattern="MM/dd/yyyy" value="#{citaController.selected.fechacita}" 
                                    title="#{bundle.EditCitaTitle_fechacita}" required="true" 
                                    requiredMessage="#{bundle.EditCitaRequiredMessage_fechacita}" 
                                    showOn="button"/>
                        
                        <p:outputLabel value="#{bundle.EditCitaLabel_detallecita}" for="detallecita" />
                        <p:inputTextarea id="detallecita" value="#{citaController.selected.detallecita}" 
                                     title="#{bundle.EditCitaTitle_detallecita}" required="true" 
                                     requiredMessage="#{bundle.EditCitaRequiredMessage_detallecita}" 
                                     rows="5" cols="30" autoResize="false" />
                        
                        <p:outputLabel value="#{bundle.EditCitaLabel_idpaciente}" for="idpaciente" />
                        <p:selectOneMenu id="idpaciente" value="#{citaController.selected.idpaciente}" 
                                         required="true" requiredMessage="#{bundle.EditCitaRequiredMessage_idpaciente}">
                            <f:selectItem itemLabel="#{bundle.SelectOneMessage}"/>
                            <f:selectItems value="#{pacientesController.itemsAvailableSelectOne}"
                                           var="idpacienteItem"
                                           itemValue="#{idpacienteItem}"/>
                        </p:selectOneMenu>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{citaController.update}" value="#{bundle.Save}" update="display,:CitaListForm:datalist,:growl" oncomplete="handleSubmit(args, 'CitaEditDialog');"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="CitaEditDialog.hide()"/>
                </h:panelGroup>
            </h:form>
        </p:dialog>

    </ui:composition>
</html>
